From: Jasper St. Pierre Date: Sun, 17 Feb 2013 18:51:51 +0000 (-0500) Subject: overviewControls: Fix reallocation cycles X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4806 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e19a927579942e95d0719a47a3ac6e4fd317baa5;p=gnome-shell.git overviewControls: Fix reallocation cycles Instead of setting a new height, let the Clutter relayout machinery do the work for us. --- diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index 93420909c..1a0dc3d0b 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -3,6 +3,7 @@ const Clutter = imports.gi.Clutter; const Lang = imports.lang; const St = imports.gi.St; +const Shell = imports.gi.Shell; const Main = imports.ui.main; const Tweener = imports.ui.tweener; @@ -305,14 +306,11 @@ const SlidingControlContainer = new Lang.Class({ child.x_expand = true; this.add_actor(child); - let entryClone = new St.Widget(); - entryClone.height = entryBin.height; + let entryClone = new Shell.GenericContainer(); + entryClone.connect('get-preferred-height', function(actor, forWidth, alloc) { + [alloc.min_size, alloc.natural_size] = [entryBin.height, entryBin.height]; + }); this.add_actor(entryClone); - - entryBin.connect('notify::height', Lang.bind(this, - function() { - entryClone.height = entryBin.height; - })); } });